package com.egao.common.publicly;

import com.egao.common.core.web.JsonResult;
import com.egao.common.publicly.entity.PubliclyCareerVO;
import com.egao.common.publicly.service.PubliclyCalendarService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 日历
 * @author pyx
 */
@Api(tags = "日历信息")
@RestController
@RequestMapping("${api}")
public class PubliclyCalendarController {
    @Autowired
    private PubliclyCalendarService publiclyCalendarService;

    @ApiOperation("列表(一个月内)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "date", value = "日期时间(2021-03-01格式)", required = true, dataType = "String", paramType = "query"),

    })
    @GetMapping("/publicly/calendar/month/list")
    public JsonResult listMonth(String date){
        return publiclyCalendarService.listCareerCalendarMonth(date);
    }

    @ApiOperation("列表(一个天内)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "date", value = "日期时间(2021-03-01格式)", required = true, dataType = "String", paramType = "query"),

    })
    @GetMapping("/publicly/calendar/day/list")
    public JsonResult listDay(String date){
        return publiclyCalendarService.listCareerCalendarDay(date);
    }
}
